<span dojoType="dojo.data.ItemFileReadStore" jsId="task<?= $this->task_id?>FilesStore" url="/NKApp/file/list/task_id/<?= $this->task_id?>"></span>

<table
title="<?= $this->header ?>"
autoHeight="10"
id="task<?= $this->task_id?>Files"
dojoType="dojox.grid.DataGrid"
store="task<?= $this->task_id?><?= $this->type?>FilesStore"
onRowClick="viewFile<?= $this->task_id?>">
	<thead>
		<tr>
			<th field="user" width="auto">
				User
			</th>
			<th field="filename" width="auto">
				Name
			</th>
			<th field="mime_type" width="auto">
				Type
			</th>
			<th field="size" width="auto">
				Size
			</th>
			
		</tr>
	</thead>
</table>
<script language="javascript">
	viewFile<?= $this->task_id?> = function(e)
	{
		var fileLocation = '/NKApp/file/view/file_id/' + this.store.getValue(this.getItem(e.rowIndex), 'file_id')
		var fileWindow = window.open(fileLocation);
		/*
		if(!fileWindow)
		{
			fileWindow = window.open('');
			fileWindow.location = fileLocation;
		}
		*/
	}

</script>
